x86/ioapic: Fix fixmap error path logic in ioapic_init_mappings()
authorAndrew Cooper <andrew.cooper3@citrix.com>
Fri, 11 Sep 2020 12:06:48 +0000 (14:06 +0200)
committerJan Beulich <jbeulich@suse.com>
Fri, 11 Sep 2020 12:06:48 +0000 (14:06 +0200)
commiteca6d5e914ddc134b3c4d2697e40002182eb6c06
treeabab6c8a4c80b966ac8e420f1bcb5d4167a24c9a
parentc3a0fc22af90ef28e68b116c6a49d9cec57f71cf
x86/ioapic: Fix fixmap error path logic in ioapic_init_mappings()

In the case that bad_ioapic_register() fails, the current position of idx++
means that clear_fixmap(idx) will be called with the wrong index, and not
clean up the mapping just created.

Increment idx as part of the loop, rather than midway through the loop body.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
master commit: b4175c6693e089ffcd77cd1ea388e76e67d36d57
master date: 2020-08-05 17:35:11 +0100
xen/arch/x86/io_apic.c